Dereference relative symlinks when staging user themes - #9280
Open
fresh3nough wants to merge 1 commit into
Open
Conversation
User themes that keep colors.toml as a relative symlink into a dotfiles tree were staged with cp -r, which copies link text verbatim. After the swap into current/theme the relative path resolves from the wrong depth, colors.toml goes dangling, and template generation silently produces nothing. Stage user themes by dereferencing symlink content instead. Fixes omacom#9253 Signed-off-by: fresh3nough <anonwurcod@proton.me>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #9253.
User-authored themes under
~/.config/omarchy/themes/<name>/that keepcolors.tomlas a relative symlink (typical dotfiles layout) were staged withcp -r, which copies the link text verbatim. After the swap into~/.local/state/omarchy/current/theme/, that relative path resolves from the wrong depth,colors.tomlbecomes a dangling symlink, andomarchy-theme-set-templatessilently generates nothing — no ghostty colors, no bar theme, etc.Installed (git-cloned) themes keep the existing refuse-symlinks path. Only the non-repo user-theme path changes.
Change
Replace bare
cp -rfor user themes withstage_user_theme/stage_user_theme_dir, which dereference resolving symlinks (cp -L/cp -rL) and skip dangling ones with a warning.Test plan
colors.tomlstaged as dangling; noghostty.confghostty.confgeneratedtest/shell.d/theme-staging-test.shpasses (new case + existing installed-theme symlink refusal)